/* 全局样式 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
  color: #1890ff;
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 600;
}

.header p {
  color: #666;
  margin: 0;
  font-size: 16px;
}

.chat-container {
  display: flex;
  gap: 20px;
  height: calc(100vh - 200px);
  min-height: 600px;
}

.chat-panel {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #fafafa;
}

.chat-input-area {
  padding: 20px;
  border-top: 1px solid #f0f0f0;
  background: white;
}

.message-card {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-user {
  background: #1890ff;
  color: white;
  margin-left: auto;
  max-width: 70%;
}

.message-bot {
  background: white;
  border: 1px solid #f0f0f0;
  max-width: 70%;
}

.thought-process {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  color: #52c41a;
}

.action-info {
  background: #fff7e6;
  border: 1px solid #ffd591;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  color: #fa8c16;
}

.observation-info {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  color: #ff4d4f;
}

.sidebar {
  width: 300px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow-y: auto;
}

.upload-area {
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: #1890ff;
}

.upload-area.drag-over {
  border-color: #1890ff;
  background: #f6ffed;
}

.voice-button {
  width: 100%;
  height: 48px;
  margin-bottom: 16px;
}

.voice-button.recording {
  background: #ff4d4f;
  border-color: #ff4d4f;
}

.voice-button.recording:hover {
  background: #ff7875;
  border-color: #ff7875;
}

.ocr-result {
  background: #f0f9ff;
  border: 1px solid #bae7ff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.ocr-result h4 {
  margin: 0 0 8px 0;
  color: #1890ff;
}

.ocr-result p {
  margin: 4px 0;
  font-size: 14px;
}

.loading-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1890ff;
  font-size: 14px;
}

.refund-link {
  display: inline-block;
  padding: 8px 16px;
  background: #52c41a;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  margin-top: 8px;
  transition: background 0.3s;
}

.refund-link:hover {
  background: #389e0d;
  color: white;
  text-decoration: none;
}

.error-message {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #ff4d4f;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chat-container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
  }

  .header h1 {
    font-size: 24px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-card {
  animation: fadeIn 0.3s ease-out;
}

.thinking-animation {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
